package net.lainiao.reptile;


import org.springframework.stereotype.Service;

import java.util.HashMap;

/**
 * Created by Administrator on 2017/1/9.
 */
@Service
public class ReptileServiceControl {
    public HashMap<String,Integer> getStatus(){
        HashMap<String,Integer> map=new HashMap<>();
        map.put("爬虫",ReptileService.status);
        map.put("索引",IndexService.status);
        return map;
    }

    public String start(String serviceName){
        if(serviceName=="爬虫"){
            return ReptileService.start();
        }
        if(serviceName=="索引"){
            return IndexService.start();
        }
        return null;
    }

    public String stop(String serviceName){
        if(serviceName=="爬虫"){
            return ReptileService.stop();
        }
        if(serviceName=="索引"){
            return IndexService.stop();
        }
        return null;
    }
}
